$(function(){
  // 百度地图API功能
  var map = new BMap.Map("position");
  var point = new BMap.Point(114.228242, 30.605721);
  map.centerAndZoom(point, 16);
  var marker = new BMap.Marker(point)
  var label = new BMap.Label("木兮地板湖北营销中心",{offset:new BMap.Size(20,-10)});

  label.setStyle({
      maxWidth: "none",
      color: "#2dae36",
      fontSize: "16px !important",
      borderRadius: "8px",
      padding: "4px 8px !important",
      background: "rgba(255,255,255,0.5)",
      borderColor: "#2dae36",
      borderStyle: "solid",
      paddingTop: "4px",
      paddingBottom: "4px",
      paddingLeft: "8px",
      paddingRight: "8px",
      lineHeight: "20px",
      borderWidth: "1px",
  });

  //点击定位弹出提示框
  marker.addEventListener("click", function(){          
      alert("木兮地板湖北营销中心");
  });
  marker.setLabel(label);

  map.addOverlay(marker);
  map.setCurrentCity("Wuhan");

  // 添加带有定位的导航控件
  var navigationControl = new BMap.NavigationControl({
    // 靠左上角位置
    anchor: BMAP_ANCHOR_TOP_LEFT,
    // LARGE类型
    type: BMAP_NAVIGATION_CONTROL_LARGE,
    // 启用显示定位
    enableGeolocation: true
  });
  map.addControl(navigationControl);
})